<script type="text/javascript" src="../../static/js/prompt.js" th:src="@{/js/prompt.js}"></script>
<div class="x_panel">
    <div class="row">
        <form action="" id="findForm" class="form-inline">
            <label class="col-md-1 control-label" style="line-height: 35px;text-align: right">角色名称：</label>
            <div  class=" col-md-2 col-sm-1 col-xs-1" style="padding: 0;margin: 0">
                <input  class="form-control" style="width: 100%" type="text"  name="roleName" th:value="${roleName}"/>
            </div>
            <label class="col-md-1 control-label" style="line-height: 35px;text-align: right">角色编码：</label>
            <div class=" col-md-2 col-sm-1 col-xs-1" style="padding: 0;margin: 0">
                <input  class="form-control" style="width: 100%"  type="text" name="roleCode" th:value="${roleCode}"/>
            </div>
            <label class="col-md-1 control-label" style="line-height: 35px;text-align: right">角色描述：</label>
            <div class="col-md-2 col-sm-1 col-xs-1" style="padding: 0;margin: 0">
                <input  class="form-control" style="width: 100%" type="text" name="roleContent" th:value="${roleContent}"/>
            </div>

            <!--<button id="search" class="btn btn-round btn-success fa fa-search" style="margin-top:4px;margin-left: 15px;background: #337ab7" type="button" onclick="find()">搜索</button>-->
            <button type="button" name="insert" class="btn btn-primary pull-right" onclick="insertTo()">添加</button>
            <button type="button" class="btn btn-primary pull-right" onclick="find()" id="search" >查询</button>
            <!--<button type="button" onclick="backToList()" class="btn btn-info pull-right">刷新</button>-->
        </form>
    </div>
</div>
    <!--<div style="width: 100%; margin: 20px 0 20px 0; border-bottom: 2px solid #E6E9ED;"></div>-->
    <div class="table-responsive" style="margin-top: 20px">
        <table class="table table-striped jambo_table bulk_action">
            <thead>
            <tr class="headings">
                <th class="column-title" style="display: table-cell;">序号</th>
                <th class="column-title" style="display: table-cell;">角色名称</th>
                <th class="column-title" style="display: table-cell;">角色编码</th>
                <th class="column-title" style="display: table-cell;">角色描述</th>
                <th class="column-title" style="display: table-cell;">创建时间</th>
                <th class="column-title" style="display: table-cell;">操作</th>
            </tr>
            </thead>

            <tbody>
            <tr class="even pointer" th:each="data,iterStat : ${datas.content}">
                <td th:text="${iterStat.count}">0</td>
                <td th:text="${data.roleName}">23100</td>
                <td th:text="${data.roleCode}">233</td>
                <td th:text="${data.roleContent}">管理员</td>
                <td  th:text="${#dates.format(data.cdate, 'yyyy-MM-dd HH:mm:ss')}">2000-01-01</td>
                <!--<td th:each="dataChild,iterStat : ${datas.cgEmps}">管理员</td>-->
                <td>
                    <!--<button type="button" onclick="auth()">权限</button>-->
                    <button name="update" class="fa fa-pencil-square-o btn btn-round btn-default" type="button" th:id="${data.roleId}" onclick="updateTo(this)">修改</button>
                    <button name="setMenu" class="fa fa-file-text-o btn btn-round btn-default" type="button" th:id="${data.roleId}" onclick="toMenu(this)">设置菜单</button>
                    <button name="delete" class="fa fa-minus-circle btn btn-round btn-default" id="delete" type="button"  th:id="${data.roleId}" onclick="deleteRole(this)">删除</button>
                </td>
            </tr>
            <!--<tr class="even pointer">-->
            <!--<td class=" ">121000040</td>-->
            <!--<td class=" ">May 23, 2014 11:47:56 PM </td>-->
            <!--<td class=" ">121000210 <i class="success fa fa-long-arrow-up"></i></td>-->
            <!--<td class=" ">John Blank L</td>-->
            <!--<td class=" ">Paid</td>-->
            <!--<td class="a-right a-right ">$7.45</td>-->
            <!--<td class=" last"><a href="#">View</a>-->
            <!--</td>-->
            <!--</tr>-->
            </tbody>
        </table>
    </div>
    <!--<div style="width: 100%; margin: 20px 0 20px 0; border-bottom: 2px solid #E6E9ED;"></div>-->
    <div id="pagination" class="col-md-12 pagination" th:replace="pagination :: pagination">
    </div>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        var flag=/*[[${flags}]]*/0;
        if(flag==0){
            $("[name=insert]").hide();
            $("[name=setMenu]").hide();
            $("[name=delete]").hide();
            $("[name=update]").hide();
        }else if(flag==1) {
            $("[name=setMenu]").show();
            $("[name=update]").show();
            $("[name=insert]").show();
            $("[name=delete]").show();
        }
    })
</script>